//
// Created by whg on 2025-06-01.
//

#ifndef PYVM_2025_ARRAYLIST_HPP
#define PYVM_2025_ARRAYLIST_HPP


template <typename T>
class ArrayList {
private:
    int _capacity;
    int _length;
    T* _array;

    void expand();

public:
    ArrayList(int capacity = 8);

    void add(T t);
    void insert(int index, T t);
    T get(int index);
    void set(int index, T t);
    int capacity();
    int length();

    void push(T t);
    T pop();
};

class PyObject;
typedef ArrayList<PyObject*>* ObjList;


#endif //PYVM_2025_ARRAYLIST_HPP
